package com.daxt.utils;

import java.io.InputStream;

import org.apache.tika.Tika;
import org.apache.tika.exception.TikaException;

public class FileValidate {

	public static boolean validate(InputStream inputStream) {
		try {
		     Tika tika = new Tika();
		    // URL url = new URL(urlStrng);
		   //  File file = new File("");
		  //   InputStream inputStream = new FileInputStream(file);
		     tika.parseToString(inputStream);
		  //   tika.parseToString(file);
		   // tika.parseToString(url);
		     //System.out.println(sb);
		     return true;
		 } catch (TikaException e) {
		     e.printStackTrace();
		     return false;
		 } catch (Exception e) {
		     e.printStackTrace();
		     return false;
		 }
	}
}
